package com.cyt.work.wb.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 维保模块-报修单表实体类
 *
 * @author shengQiang Yu
 * @date 2019-11-28 9:27:23
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_wb_repair")
public class WbRepair implements Serializable {

	/**
     * 报修单编号
     */ 
	@Id
	private String id;

	/**
	 * 报修人id
	 */
	@Column(name = "wb_user_id")
	private String wbUserId;

	/**
     * 应用id
     */ 
	@Column(name = "apply_id")
	private String applyId;

	/**
     * 报修类型:1、简单报修，2、扫码设备报修，3、扫码场地报修
     */ 
	@Column(name = "repair_type")
	private String repairType;

	/**
     * 设备ID
     */ 
	@Column(name = "device_id")
	private String deviceId;

	/**
     * 设备名称
     */ 
	@Column(name = "device_name")
	private String deviceName;

	/**
     * 设备编号
     */ 
	@Column(name = "device_num")
	private String deviceNum;

	/**
     * 设备型号
     */ 
	@Column(name = "device_model")
	private String deviceModel;

	/**
     * 场所id
     */ 
	@Column(name = "room_id")
	private String roomId;

	/**
     * 场所名称
     */ 
	@Column(name = "room_name")
	private String roomName;

	/**
     * 故障图片
     */ 
	@Column(name = "images")
	private String images;

	/**
     * 描述信息
     */ 
	@Column(name = "description")
	private String description;

	/**
     * 报修单状态（1.待分配 2.待维修 3.返修 4.待确认 5.完成）
     */ 
	@Column(name = "status")
	private String status;

	/**
	 * 服务商id
	 */
	@Column(name = "servicer_id")
	private String servicerId;

	/**
     * 当前维修人id
     */ 
	@Column(name = "repairman_id")
	private String repairmanId;

	/**
     * 当前维修人名称
     */ 
	@Column(name = "repaiman_name")
	private String repaimanName;

	/**
     * 当前维修人手机号
     */ 
	@Column(name = "repaiman_phone")
	private String repaimanPhone;

	/**
     * 删除标识
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
	 * 评价内容
	 */
	@Column(name = "pj_content")
	private String pjContent;

	/**
	 * 评价分数
	 */
	@Column(name = "pj_score")
	private int pjScore;

	/**
	 * 评价指标
	 */
	@Column(name = "pj_target")
	private String pjTarget;

	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author shengQiang Yu
	 * @date 2019-11-28 9:27:23
	 */
	public WbRepair(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.updateTime = new Date();
		if(sysUser!=null){
			this.createUser = sysUser.getId();
			this.updateUser = sysUser.getId();
		}
	}

}